<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Регистрация</title>
    <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
    <link rel="stylesheet" type="text/css" href="/css/template.css"/>
    <link rel="stylesheet" type="text/css" href="/css/gallery.css"/>
    <link rel="stylesheet" type="text/css" href="/css/dark.css"/>
    <link rel="stylesheet" type="text/css" href="/css/buttons.css"/>
    <link href='http://fonts.googleapis.com/css?family=Lobster&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
    <script type="text/javascript" src="/js/jquery-1.8.2.js"></script>
    <script type="text/javascript" src="/js/validation.js"></script>
</head>
<body>

<div class="description">
    <div class="content">
        <a href="javascript:void(0)" id="close"><img src="/img/icons/close.png"></a>

        <p id="text_content">Уважаемый посетитель!<br/>Заполняйте все поля корректно! Поля отмечанные *
            обязательны для заполнения!</p>
    </div>
</div>

<div class="auth">
    <div class="title">
        <h1>Регистрация</h1>
        <a href="/user/auth.html">Войти</a>
    </div>

    <c:if test="${not empty param.error}">
        <script type="text/javascript">
            $('document').ready(function() {
                <c:if test="${param.error=='email'}">
                $('#text_content').html("Данный Email адрес уже занят!");
                </c:if>

                <c:if test="${param.error=='login'}">
                $('#text_content').html("Данное имя пользователя занято!");
                </c:if>
            })

        </script>
    </c:if>


    <form:form modelAttribute="user" method="post" action="/user/register_user.html" id="AuthFormId">
        <div class="form_item">
            <form:label path="login">
                <spring:message code="label.login"/>:&nbsp;</form:label>
            <div class="form_field">
                <form:input type="text" value="" path="login" id="j_username"/>
            </div>
        </div>

        <div class="form_item"><form:label path="password"><spring:message code="label.password"/>:&nbsp;</form:label>

            <div class="form_field">
                <form:input type="password" value="" path="password" id="password"/>
            </div>
        </div>
        <div class="form_item"><label for="repeat_password">Повторить пароль:&nbsp;</label>

            <div class="form_field">
                <input type="password" value="" name="repeat_password" id="repeat_password"/>
            </div>
        </div>
        <div class="form_item"><form:label path="email">Email:&nbsp;</form:label>

            <div class="form_field">
                <form:input type="text" value="" path="email" id="email"/>
            </div>
        </div>
        <div class="form_item"><form:label path="phone">Телефон:&nbsp;</form:label>

            <div class="form_field">
                <form:input type="text" value="" path="phone" id="phone"/>
            </div>
        </div>

        <div class="form_item">
            <button type="submit" class="button red" id="submit_btn"><span>Регистрация</span></button>
        </div>
    </form:form>

</div>
</div>
</body>
</html>